package com.xiaoxi.xiojcodesandbox.unsafecode;

import java.io.FileWriter;
import java.io.IOException;

public class UnsafeWrite {

    public static void main(String[] args) {
        try (FileWriter writer = new FileWriter("a.txt")) {
            writer.write("1111");
            System.out.println("成功写入文件");
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println("写入文件时发生错误");
        }
    }
}